-- summon_building
-- create by zhuangsl
-- 道具： 召唤建筑物

return {
    apply = function(source, target, classId, value)
        if source.type ~= OBJECT_TYPE_USER then
            return false;
        end

        local element = value;
        local class = DungeonM.queryElement(element, "class");
        local pos = SummonM.findSummonPos();

        -- 如果没有位置了
        if pos <= 0 then
            return false;
        end

        local para = { ["class"] = class, ["element"] = element, ["open_round"] = CombatM.getRound() };
        DungeonM.transformGrid(class, pos, GRID_STATE_OPEN, para);
    end,
};
